﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Http;

namespace ShoppingCart.WebApi
{
    public static class WebApiConfig
    {
        public static void Register(HttpConfiguration config)
        {
            config.Routes.MapHttpRoute(
                name: "ShoppingCartAPI",
                routeTemplate: "api/{controller}/{encodedUserId}",
                defaults: new { encodedUserId = RouteParameter.Optional });

            config.Routes.MapHttpRoute(
                name: "ShoppingCartItemAPI",
                routeTemplate: "api/cart/{encodedUserId}/{controller}/{prodId}",
                defaults: new { prodId = RouteParameter.Optional});
        }
    }
}
